package main;

public class ErrorLog  extends javax.swing.JFrame {

	private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextArea tipsStr;

    private static final long serialVersionUID = 1L;
	
	public ErrorLog(String message, StackTraceElement[] text){
		initComponents(message,text);
		setDefaultCloseOperation(DISPOSE_ON_CLOSE);
		setTitle("错误信息");
		setBounds(100, 30, 500, 550);
		setVisible(true);
	}
	
	private void initComponents(String message,StackTraceElement[] text) {
		jScrollPane1 = new javax.swing.JScrollPane();
        tipsStr = new javax.swing.JTextArea();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        tipsStr.setEditable(false);
        tipsStr.setColumns(60);
        tipsStr.setRows(15);
        jScrollPane1.setViewportView(tipsStr);
        tipsStr.append(message);
        for(StackTraceElement s:text){
			tipsStr.append(s.toString()+"\n");
		}

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 239, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 197, Short.MAX_VALUE)
                .addContainerGap())
        );

        
        jScrollPane1.setViewportView(tipsStr);
	}
	
	 
}
